#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int x = 0;
	int n = 0;
	int sum = 0;
	scanf("%d%d", &x, &n);
	for (int i = 1; i <= n; i++)
	{
		if ((x % 7 ) != 6 && (x % 7 ) != 0)
			sum += 250;
		x++;
	}
	printf("%d", sum);
	return 0;
}